package com.dense.kuiniu.bookborrow.xjSetting.listener;


import android.view.View;
import android.widget.AdapterView;


/**
 * @Author xiajun
 * @Date 2019/11/26-15:27
 * @Email 809939691@qq.com
 */
public abstract class XJOnItemClickListener implements AdapterView.OnItemClickListener {
    /**
     * 事件控制避免反复点击
     */
    private static long time = 0;
    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
        if (time != 0 && (System.currentTimeMillis() - time) < 500) {
            return;
        }
        time = System.currentTimeMillis();
        onClickItem(adapterView,view,i,l);
    }
    protected abstract void onClickItem(AdapterView<?> adapterView, View view, int i, long l);
}
